﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace CTM.Web.Models.Input
{
    public class Comment
    {
        #region Properties

        [Key]
        public Guid Id { get; set; }

        [Required]
        public string Content { get; set; }

        public bool IsDeleted { get; set; }

        public DateTime CreatedOn { get; set; }

        [StringLength(128)]
        public string CreatedBy { get; set; }

        public DateTime? ModifiedOn { get; set; }

        [StringLength(128)]
        public string ModifiedBy { get; set; }

        #endregion

        #region Relationship
        public virtual Post Post { get; set; }
        [InverseProperty("Comment")]
        public virtual ICollection<Notification> Notifications { get; set; }
        #endregion

        public Comment()
        {
            IsDeleted = false;
            CreatedOn = DateTime.UtcNow;
            //ModifiedOn = DateTime.UtcNow;
            Notifications = new HashSet<Notification>();
        }
    }
}